<template>
  <view style="width: 100%;padding-bottom: 140rpx">
    <view class="img-box">
      <image
          class="cook-img"
          mode="widthFix"
          style="width: 100%; height: auto"
          src="https://images.unsplash.com/photo-1544025162-d76694265947?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"/>
      <view class="cook-title">
        <view style="font-size: 34rpx;font-weight: 600;font-family: 微软雅黑,serif">澳洲谷饲牛排</view>
        <view style="font-size: 24rpx;margin-top: 10rpx;" class="flex">
          <view style="margin-right: 20rpx"> • 难度：初级</view>
          <view style="margin-right: 20rpx"> • 时间：15分钟</view>
          <view> • 评分：4.8</view>
        </view>
      </view>
      <view class="cook-tag flex">
        <view>#早餐</view>
        <view>#中级</view>
        <view>#营养</view>
      </view>
    </view>
    <a-card :shadow="false">
      <text class="f-c-3">
        今天分享一道超级简单的家常菜，酸甜可口，营养丰富，5分钟就能搞定，特别适合忙碌的上班族，这道菜就是番茄炒鸡蛋，他的制作步骤是：
        今天分享一道超级简单的家常菜，酸甜可口，营养丰富，5分钟就能搞定，特别适合忙碌的上班族，这道菜就是番茄炒鸡蛋，他的制作步骤是：
      </text>
    </a-card>
    <a-card :shadow="false">
      <view class="tag">
        所需食材（2人份）
      </view>
      <view class="grid-2" style="margin-top: 30rpx;font-size:26rpx">
        <view>
          <span style="color: #ff6d70">200g</span>南瓜
        </view>
        <view>
          <span style="color: #ff6d70">200g</span>南瓜
        </view>
        <view>
          <span style="color: #ff6d70">200g</span>南瓜
        </view>
        <view>
          <span style="color: #ff6d70">200g</span>南瓜
        </view>
      </view>
    </a-card>
    <a-card :shadow="false">
      <view class="tag">
        制作步骤
      </view>
      <view style="margin-top: 30rpx;font-size:26rpx">
        <view v-for="(item,i) in steps" :key="i" class="step-box">
          <view class="step-tag">{{ i + 1 }}</view>
          <view style="flex: 1">
            {{ item.content }}
          </view>
        </view>
      </view>
    </a-card>
    <a-card :shadow="false">
      <view class="tag">
        烹饪小贴士
      </view>
      <ul style="padding-left: 20px; color: #666;margin-top: 30rpx;font-size: 26rpx">
        <li style="margin-bottom: 8px;">南瓜选择贝贝南瓜会更甜糯</li>
        <li style="margin-bottom: 8px;">藜麦煮前浸泡30分钟更容易消化</li>
        <li style="margin-bottom: 8px;">酱汁现做现用，避免蔬菜出水</li>
        <li>可添加牛油果或山羊奶酪增加风味层次</li>
      </ul>
    </a-card>
    <a-card :shadow="false">
      <view class="tag">
        厨友评价
      </view>
      <view style="margin-top: 30rpx;font-size:26rpx">
        <view>
          <view class="flex">
            <up-avatar
                text="北"
                fontSize="16"
                size="35"
                randomBgColor
            ></up-avatar>
            <view style="margin-left: 10rpx">
              <view class="u-f-sl f-c-3">美食探险家</view>
              <view class="u-f-sm f-c-6">2021-08-12</view>
            </view>
            <view style="margin-left: auto">
              <up-rate activeIcon="star" inactiveIcon="star"></up-rate>
            </view>
          </view>
          <view style="margin-top: 15rpx">
            这个菜真的很好吃，我家人都说好吃，我也很喜欢，我家人都说好吃，我也很喜欢，我家人都说好吃，我也很喜欢
          </view>
          <view style="margin-top: 15rpx" class="grid-3">
            <up-image
                src="https://picsum.photos/id/100/200/200"
                width="100%"
                mode="widthFix"
                height="auto"
                radius="10"
            ></up-image>
            <up-image
                src="https://picsum.photos/id/110/200/200"
                width="100%"
                mode="widthFix"
                height="auto"
                radius="10"
            ></up-image>
            <up-image
                src="https://picsum.photos/id/120/200/200"
                width="100%"
                mode="widthFix"
                height="auto"
                radius="10"
            ></up-image>
          </view>
        </view>
      </view>
    </a-card>
  </view>
  <view class="bottom-fixed flex-between" style="border-top: #ff6d70 1px solid">
    <view class="flex-column-center like-container">
      <up-icon name="heart" size="24" color="#ff6d70"></up-icon>
      <text>212</text>
    </view>
    <view class="flex-column-center">
      <up-icon name="star" size="24" color="#ff6d70"></up-icon>
      23424
    </view>
    <view class="flex-column-center">
      <up-icon name="chat" size="24" color="#ff6d70"></up-icon>
      546
    </view>
    <view class="flex-column-center">
      <up-icon name="share" size="24" color="#ff6d70"></up-icon>
      分享
    </view>
  </view>
</template>

<script setup lang="ts">
import {ref} from 'vue';
import {gsap} from "gsap";
import ACard from "@/components/a-card.vue";

const steps = ref([
  {
    title: "第一步",
    content: "将南瓜去皮，切成小块，放入煮锅中，加入适量的水，大火煮开，转小火煮20分钟，直到南瓜软烂。"
  },
  {
    title: "第二步",
    content: "将南瓜捞出，放入搅拌机中，加入适量的水，搅拌成稀糊状。"
  },
  {
    title: "第三步",
    content: "将南瓜汁倒回锅中，加入盐、白糖、枸杞，搅拌均匀，继续煮5分钟，关火。"
  },
  {
    title: "第四步",
    content: "将南瓜汁倒入碗中，撒上葡萄干，即可享用。"
  }
])
</script>


<style scoped lang="scss">
@import "@/static/css/index.css";

page {
  background: #f7f7f7;
}

.img-box {
  position: relative;

  .cook-img::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .8));
  }

  .cook-tag {
    position: absolute;
    top: 10rpx;
    right: 10rpx;

    & > view {
      margin-left: 10rpx;
      background: rgba(255, 255, 255, 0.5);
      border-radius: 10rpx;
      color: white;
      padding: 5rpx 10rpx;
      font-size: 24rpx;
    }

  }

  .cook-title {
    position: absolute;
    bottom: 30rpx;
    left: 10rpx;
    color: white;
  }
}

.step-box {
  display: flex;
  align-items: center;
  margin-top: 20rpx;

  .step-tag {
    width: 40rpx;
    height: 40rpx;
    border-radius: 50%;
    background: #ff6d70;
    color: white;
    font-size: 24rpx;
    text-align: center;
    line-height: 40rpx;
    margin-right: 20rpx;
  }
}

.tag::before {
  content: "";
  width: 10rpx;
  height: 10rpx;
  border-radius: 4rpx;
  border-left: #ff6d70 5px solid;
  margin-right: 20rpx;
}
</style>
